home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / strlib.zip / STRPBRK.C < prev    next >
Text File  |  1993-01-04  |  768b  |  26 lines

  1.  
  2. /*  File   : strpbrk.c
  3.     Author : Richard A. O'Keefe.
  4.     Updated: 11 April 1984
  5.     Defines: strpbrk()
  6.  
  7.     strpbrk(s1, s2) returns NullS if no character of s2 occurs in s1, or
  8.     a pointer to the first character of s1 which occurs in s2  if  there
  9.     is one.  It generalises strchr (v7=index).  It wouldn't be useful to
  10.     consider NUL as part of s2, as that would occur in every s1.
  11. */
  12.  
  13. #include "strings.h"
  14. #include "_str2set.h"
  15.  
  16. char *strpbrk(str, set)
  17.     register _char_ *str;
  18.     char *set;
  19.     {
  20.         _str2set(set);
  21.         while (_set_vec[*str] != _set_ctr)
  22.             if (!*str++) return NullS;
  23.         return str;
  24.     }
  25.  
  26.